{% from '@SyliusAdmin/shared/helper/breadcrumbs.html.twig' import breadcrumbs %}

{% set configuration = hookable_metadata.context.resources.requestConfiguration %}
{% set customer = configuration.vars.customer %}


{% set breadcrumbItems = [
    { name: 'sylius.ui.dashboard', url: path('sylius_admin_dashboard'), active: false },
    { name: 'sylius.ui.customers'|trans, url: path('sylius_admin_customer_index'), active: false },
] %}

{% if customer %}
    {% set breadcrumbItems = breadcrumbItems|merge([
        { name: customer.email ?? customer.id, url: path('sylius_admin_customer_show', {'id': customer.id }), active: false },
    ]) %}
{% endif %}

{% set breadcrumbItems = breadcrumbItems|merge([
    { name: 'sylius.ui.orders'|trans, active: true },
]) %}

{{ breadcrumbs(breadcrumbItems) }}
